// HSS.Forms.BrowseModuleBase.cs
// ----------------------------------------------------------------------------
// Licensed under the MIT license
// http://www.opensource.org/licenses/mit-license.html
// ----------------------------------------------------------------------------
// HighSpeed-Solutions, LLC
// Copyright (c) 2001-2010
// ----------------------------------------------------------------------------
// File:       BrowseModuleBase.cs
// Author:     HSS\gbanta
// Created:    08/12/2010
// Modified:   12/04/2010
// ----------------------------------------------------------------------------
namespace HSS.Forms
{
	#region Using Directives
	using System;
	using System.Collections.Generic;
	using System.ComponentModel;
	using System.Windows.Forms;

	using HSS.Data;
	#endregion

	#region BrowseModuleBase
	/// <summary>
	/// Summary description for FormDetailImpl.
	/// </summary>
	[ToolboxItem(false)]
	public class BrowseModuleBase : ModuleBase
	{
		#region Constructor
		/// <summary>
		/// ctor
		/// </summary>
		public BrowseModuleBase()
		{
		}
		#endregion

		#region Properties

		#region Appearance
		/// <summary>
		/// The Borderstyle of the Container Form.
		/// </summary>
		[Description("The FormBorderStyle of the Container Form.")]
		[CategoryAttribute("Appearance")]
		public FormBorderStyle ParentBorderStyle
		{
			get
			{
				return _parentBorderStyle;
			}
			set
			{
				_parentBorderStyle = value;
			}
		} FormBorderStyle _parentBorderStyle = FormBorderStyle.Sizable;
		/// <summary>
		/// Gets or sets whether the Select button is enabled
		/// </summary>
		[Browsable(false)]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
		public bool SelectButtonEnabled
		{
			get { return ((HSS.Forms.BrowseModuleContainer)this.FindForm()).SelectButtonEnabled; }
			set { ((HSS.Forms.BrowseModuleContainer)this.FindForm()).SelectButtonEnabled = value; }
		}
		#endregion

		#region Behavior
		/// <summary>
		/// Indicates if the Dialog should close when the user selected an item.
		/// </summary>
		[Description("Indicates if the Dialog should close when the user selected an item.")]
		[Category("Behavior")]
		[DefaultValue(true)]
		public bool CloseOnSelected
		{
			get
			{
				return _closeOnSelected;
			}
			set
			{
				_closeOnSelected = value;
			}
		} bool _closeOnSelected = true;
		/// <summary>
		/// Indicates if the Container of this Module, should raise it's Selected event
		/// </summary>
		[Description("Indicates if the Container of this Module, should raise it's Selected event")]
		[Category("Behavior")]
		[DefaultValue(true)]
		public bool RaiseSelectedEvent
		{
			get { return _raiseSelectedEvent; }
			set { _raiseSelectedEvent = value; }
		} bool _raiseSelectedEvent = true;
		#endregion

		#region Display
		/// <summary>
		/// The Title or Overview for this Module
		/// </summary>
		[Description("The Title or Overview for this Module")]
		[Category("Display")]
		public string ModuleTitle
		{
			get { return _ModuleTitle; }
			set { _ModuleTitle = value; }
		} string _ModuleTitle = string.Empty;
		/// <summary>
		/// The description or action for this Module
		/// </summary>
		[Description("The description or action for this child Module")]
		[Category("Display")]
		public string ActionDescription
		{
			get { return _actionDescription; }
			set { _actionDescription = value; }
		} string _actionDescription = string.Empty;
		/// <summary>
		/// The Image to display for the Module
		/// </summary>
		[Description("The Image to display for the module.")]
		[CategoryAttribute("Display")]
		[DefaultValue(null)]
		public System.Drawing.Image Image
		{
			get { return _image; }
			set { _image = value; }
		} System.Drawing.Image _image = null;

		#endregion

		#region Layout
		/// <summary>
		/// Indicates whether or not to show the Header Area
		/// </summary>
		[Description("Indicates whether or not to show the Header Area.")]
		[CategoryAttribute("Layout")]
		[DefaultValue(true)]
		public bool HeaderVisible
		{
			get { return _headerVisible; }
			set { _headerVisible = value; }
		} bool _headerVisible = true;
		/// <summary>
		/// Indicates the desired height of the Header Area
		/// </summary>
		[Description("Indicates the desired height of the Header Area.")]
		[CategoryAttribute("Layout")]
		[DefaultValue(60)]
		public int HeaderHeight
		{
			get { return _headerHeight; }
			set { _headerHeight = value; }
		} int _headerHeight = 60;
		/// <summary>
		/// Specifies the initial position of the Parent Form.
		/// </summary>
		[Description("Specifies the initial position of the Parent Form.")]
		[CategoryAttribute("Layout")]
		[DefaultValue(true)]
		public FormStartPosition ParentStartPosition
		{
			get { return _parentStartPosition; }
			set { _parentStartPosition = value; }
		} FormStartPosition _parentStartPosition = FormStartPosition.CenterParent;

		#endregion

		#region Window Style
		/// <summary>
		/// The Icon to display for the Module's Parent Form
		/// </summary>
		[Description("The Icon to display for the Module's Parent Form.")]
		[CategoryAttribute("Window Style")]
		[DefaultValue(null)]
		public System.Drawing.Icon ParentIcon
		{
			get { return _parentIcon; }
			set { _parentIcon = value; }
		} System.Drawing.Icon _parentIcon = null;
		/// <summary>
		/// Should the Container Form show the Maximize Box.
		/// </summary>
		[Description("Should the Container Form show the Maximize Box.")]
		[CategoryAttribute("Window Style")]
		public bool MaximizeBox
		{
			get
			{
				return _containerMaximize;
			}
			set
			{
				_containerMaximize = value;
			}
		} bool _containerMaximize = true;
		/// <summary>
		/// Should the Container Form show the Minimize Box.
		/// </summary>
		[Description("Should the Container Form show the Minimize Box.")]
		[CategoryAttribute("Window Style")]
		public bool MinimizeBox
		{
			get
			{
				return _containerMinimize;
			}
			set
			{
				_containerMinimize = value;
			}
		} bool _containerMinimize = true;
		/// <summary>
		/// Should the Container Form be shown in the TaskBar.
		/// </summary>
		[Description("Should the Container Form be shown in the TaskBar.")]
		[CategoryAttribute("Window Style")]
		public bool ShowInTaskbar
		{
			get
			{
				return _showInTaskBar;
			}
			set
			{
				_showInTaskBar = value;
			}
		} bool _showInTaskBar = true;

		#endregion

		#endregion

		#region Methods
		/// <summary>
		/// Gets the selected data item
		/// </summary>
		/// <returns>the IDataContainer type selected</returns>
		public virtual List<IDataContainer> GetSelectedItems() { return null; }
		/// <summary>
		/// Gets the data contained on this Module
		/// </summary>
		/// <returns>An array of IDataContainer type</returns>
		public virtual List<IDataContainer> GetData() { return null; }
		/// <summary>
		/// Virtual Method for the loading data into the detail form
		/// </summary>
		/// <param name="Data"></param>
		public virtual bool LoadData(List<IDataContainer> Data) { return true; }
		/// <summary>
		/// Invokes the Select Button
		/// </summary>
		public void PerformSelect()
		{
			((HSS.Forms.BrowseModuleContainer)this.FindForm()).PerformSelectAction();
		}
		/// <summary>
		/// Invokes the Cancel Button
		/// </summary>
		public void PerformCancel()
		{
			((HSS.Forms.BrowseModuleContainer)this.FindForm()).PerformCancelAction();
		}
		#endregion
	}
	#endregion
}